home *** CD-ROM | disk | FTP | other *** search
-
-
-
- RRRRLLLLEEEE((((5555)))) 5555 ((((9999////11114444////88882222)))) RRRRLLLLEEEE((((5555))))
-
-
-
- NNNNAAAAMMMMEEEE
- rle - Run length encoded file format produced by the rle
- library
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The output file format is (note: all words are 16 bits, and
- in PDP-11 byte order):
-
- WWWWoooorrrrdddd 0000
- A "magic" number 0xcc52. (Byte order 0x52, 0xcc.)
-
- WWWWoooorrrrddddssss 1111----4444
- The structure (chars saved in PDP-11 order)
-
- {
- short xpos, /* Lower left corner
- ypos,
- xsize, /* Size of saved box
- ysize;
- }
-
- BBBByyyytttteeee 11110000
- (_f_l_a_g_s) The following flags are defined:
-
- _H__C_L_E_A_R_F_I_R_S_T
- (0x1) If set, clear the frame buffer to background
- color before restoring.
-
- _H__N_O__B_A_C_K_G_R_O_U_N_D
- (0x2) If set, no background color is supplied. If
- _H__C_L_E_A_R_F_I_R_S_T is also set, it should be ignored (or
- alternatively, a clear-to-black operation could be
- performed).
-
- _H__A_L_P_H_A
- (0x4) If set, an alpha channel is saved as color
- channel -1. The alpha channel does not contribute
- to the count of colors in _n_c_o_l_o_r_s.
-
- _H__C_O_M_M_E_N_T
- (0x8) If set, comments will follow the color map
- in the header.
-
- BBBByyyytttteeee 11111111
- (_n_c_o_l_o_r_s) Number of color channels present. 0 means
- load only the color map (if present), 1 means a B&W
- image, 3 means a normal color image.
-
- BBBByyyytttteeee 11112222
- (_p_i_x_e_l_b_i_t_s) Number of bits per pixel, per color
- channel. Values greater than 8 currently will not
- work.
-
-
-
- Page 1 (printed 12/1/98)
-
-
-
-
-
-
- RRRRLLLLEEEE((((5555)))) 5555 ((((9999////11114444////88882222)))) RRRRLLLLEEEE((((5555))))
-
-
-
- BBBByyyytttteeee 11113333
- (_n_c_m_a_p) Number of color map channels present. Need not
- be identical to _n_c_o_l_o_r_s. If this is non-zero, the
- color map follows immediately after the background
- colors.
-
- BBBByyyytttteeee 11114444
- (_c_m_a_p_l_e_n) Log base 2 of the number of entries in the
- color map for each color channel. I.e., would be 8 for
- a color map with 256 entries.
-
- BBBByyyytttteeeessss 11115555----............
- The background color. There are _n_c_o_l_o_r_s bytes of
- background color. If _n_c_o_l_o_r_s is even, an extra padding
- byte is inserted to end on a 16 bit boundary. The
- background color is only present if _H__N_O__B_A_C_K_G_R_O_U_N_D is
- not set in _f_l_a_g_s. IF _H__N_O _B_A_C_K_G_R_O_U_N_D is set, there is
- a single filler byte. Background color is ignored, but
- present, if _H__C_L_E_A_R_F_I_R_S_T is not set in _f_l_a_g_s.
-
- If _n_c_m_a_p is non-zero, then the color map will follow as
- _n_c_m_a_p*2^_c_m_a_p_l_e_n 16 bit words. The color map data is
- left justified in each word.
-
- If the _H__C_O_M_M_E_N_T flag is set, a set of comments will
- follow. The first 16 bit word gives the length of the
- comments in bytes. If this is odd, a filler byte will
- be appended to the comments. The comments are
- interpreted as a sequence of null terminated strings
- which should be, by convention, of the form _n_a_m_e=_v_a_l_u_e,
- or just _n_a_m_e.
-
- Following the setup information is the Run Length
- Encoded image. Each instruction consists of an opcode,
- a datum and possibly one or more following words (all
- words are 16 bits). The opcode is encoded in the first
- byte of the instruction word. Instructions come in
- either a short or long form. In the short form, the
- datum is in the second byte of the instruction word; in
- the long form, the datum is a 16 bit value in the word
- following the instruction word. Long form instructions
- are distinguished by having the 0x40 bit set in the
- opcode byte. The instruction opcodes are:
-
- SSSSkkkkiiiippppLLLLiiiinnnneeeessss ((((1111))))
- The datum is an unsigned number to be added to the
- current Y position.
-
- SSSSeeeettttCCCCoooolllloooorrrr ((((2222))))
- The datum indicates which color is to be loaded with
- the data described by the following ByteData and
- RunData instructions. Typically, 0->red, 1->green,
-
-
-
- Page 2 (printed 12/1/98)
-
-
-
-
-
-
- RRRRLLLLEEEE((((5555)))) 5555 ((((9999////11114444////88882222)))) RRRRLLLLEEEE((((5555))))
-
-
-
- 2->blue. The operation also resets the X position to
- the initial X (i.e. a carriage return operation is
- performed).
-
- SSSSkkkkiiiippppPPPPiiiixxxxeeeellllssss ((((3333))))
- The datum is an unsigned number to be added to the
- current X position.
-
- BBBByyyytttteeeeDDDDaaaattttaaaa ((((5555))))
- The datum is one less than the number of bytes of color
- data following. If the number of bytes is odd, a
- filler byte will be appended to the end of the byte
- string to make an integral number of 16-bit words. The
- X position is incremented to follow the last byte of
- data.
-
- RRRRuuuunnnnDDDDaaaattttaaaa ((((6666))))
- The datum is one less than the run length. The
- following word contains (in its lower 8 bits) the color
- of the run. The X position is incremented to follow
- the last byte in the run.
-
- EEEEOOOOFFFF ((((7777))))
- This opcode indicates the logical end of image data. A
- physical end-of-file will also serve as well. The EEEEOOOOFFFF
- opcode may be used to concatenate several images in a
- single file.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- _l_i_b_r_l_e(_3)
-
- AAAAUUUUTTTTHHHHOOOORRRR
- Spencer W. Thomas, Todd Fuqua
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 3 (printed 12/1/98)
-
-
-
-